// This file is part of RedAlert.
//
// RedAlert is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// RedAlert is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with RedAlert.  If not, see <http://www.gnu.org/licenses/>.
//
// Author: Nicolas Catania (nicolas.catania@gmail.com)

package com.appspot.redalert;

import java.util.ArrayList;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

public class BootCompletedReceiver extends BroadcastReceiver {
  private Log log;

  public BootCompletedReceiver() {
    log = Log.getInstance();
  }

  // @Override
  public void onReceive(Context context, Intent intent) {
    if (intent.getAction().equals(Intent.ACTION_BOOT_COMPLETED)) {
      log.d("Resuming");
      
      ArrayList<Person> allPerson = Person.load(context);
      
      // Look in the DB the current configuration
      int days_left = 0;

      StringBuilder msg = new StringBuilder(90);

      msg.append("Scheduling notification in ").append(days_left).append(" days.");

      log.d(msg.toString());

      // Register with the alarm manager to run and notify.
      //NotificationController controller = new NotificationController(context);

      //controller.sendNotification(days_left);
    }
  }
}
